<style>
    .viplogo{width:180px;height:90px;margin-bottom:10px;}
    .adminvip h2{text-align:center;font-size:14px;height:25px;line-height:20px;}
    .adminvip h3{font-size:12px;line-height:20px;height:20px;background:#393;color:#fff;float:left;position:absolute;padding:0 5px;top:8px;left:8px;}
    .adminvip{padding:20px 40px 10px 40px;}
    .adminvip li{float:left;width:180px;padding:8px;border:#ddd solid 1px;height:150px;margin-right:30px;display:inline;position:relative;z-index:1;margin-bottom:30px;}
    .adminvip p{text-align:center;}
    .adminvip p span{padding:0 10px;}
    .adminvip p a{color:#005aa0;}
    .adminvip p a:hover{color:#f60;text-decoration:underline;}
</style>
<div class="">
    <div class="admin_nrtop">
        <div class="ad_search">
            <div class="search">
                <form action="/admini/express/viplist/"  method="get" style="margin:0px" id="form1">
                    <div class="soubox">
                        <input type="text" id="name" name="name" value="<?php echo $this->name?$this->name:"";?>" placeholder="输入快递名称">
                    </div>
                    <a href="javascript:$('#form1').submit();"><span>搜索</span></a>
                </form>
            </div>
        </div>
    </div>
    <div class="adminvip">
        <ul>
            <?php if($this->expressList){
                foreach ($this->expressList as $Item) { ?> 
                <li>
                    <?php if(in_array($Item->Id, $this->viplist)){ ?>
                    <h3>已设置</h3>
                    <?php } ?>
                    <div class="viplogo">
                        <?php if($Item->logo){ ?>
                            <img  src="<?php echo $Item->logo; ?>" height="90px" width="180px" />
                        <?php }else{ ?>
                            无logo图
                        <?php } ?>
                    </div>
                    <h2><a href="/admini/express/epdetail/id/<?php echo $Item->Id;?>" class="indexa"><?php echo $Item->Name;?></a></h2>
                    <p>
                        <a href="/admini/express/vip/id/<?php echo $Item->Id;?>" data-id="<?php echo $Item->Id;?>" >修改设置</a>
                        <?php if(in_array($Item->Id, $this->viplist)){ ?>
                        <span>|</span>
                        <a name='clean' href="javascript:;" data-id="<?php echo $Item->Id;?>">清除</a>
                        <?php } ?>
                    </p>
                </li>
            <?php
                }
                }else{
                    echo "<font size='4' color='red'>暂无数据</font>";
                }
            ?>
        </ul>
        <div style="clear:both"></div>
    </div>
    <div class="ccbar">
        <?php
        echo $this->partial('paging.phtml', array("pages" => $this->expressAll,"pamas"=>"name=$this->name&isVolume=$this->isVolume&isDisable=$this->isDisable&isInvoice=$this->isInvoice&isRemoteFee=$this->isRemoteFee"));        
        ?>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        $('[name=clean]').click(function(){
            var id   = $(this).attr('data-id');
            var name = $(this).parent().siblings("h2").text();

            if(confirm("您确定清除快递 ("+name+") vip优惠？","提示信息")){
                $.ajax({    
                    type: 'get',
                    url: '/admini/express/vipclean/id/'+id,
                    dataType : 'json',
                    success: function(_d) {
                        if(_d.s == 0){
                            alert("快递 ("+name+") vip优惠清除成功！");
                            location.reload();
                        }else{
                            alert("发生未知错误，请重新操作");
                        }
                    }
                });
            }
        })
    })
</script>